package com.atguigu.stgy.admin.controller;

import com.atguigu.stgy.admin.service.FeeValueService;
import com.atguigu.stgy.model.entity.AttrValue;
import com.atguigu.stgy.model.entity.FeeValue;
import com.atguigu.stgy.admin.service.impl.FeeValueServiceImpl;
import com.atguigu.stgy.model.result.R;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

//

/**
 * 杂项费用值表(fee_value)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/admin/fee")
public class FeeValueController {
    /**
     * 服务对象
     */
    @Resource
    private FeeValueService feeValueService;

    @Operation(summary = "新增/更新 杂费信息属性值")
    @PostMapping("value/saveOrUpdate")
    public R saveOrUpdate(@RequestBody FeeValue feeValue){
        feeValueService.saveOrUpdate(feeValue);
        return R.ok();
    }
    ///attr/key/deleteById?attrKeyId=1795621399293964289
    @Operation(summary = "删除 杂费信息属性值")
    @DeleteMapping("value/deleteById")
    public R deleteById(@RequestParam("id")Long id){
        feeValueService.removeById(id);
        return R.ok();
    }
}
